<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <link rel="stylesheet" href="../../../plugin/bootstrap/css/bootstrap.css" />
    <link rel="stylesheet" href="../../../plugin/layui/css/layui.css" />
    <link rel="stylesheet" href="../../../plugin/swiper/swiper.min.css" />
    <link rel="stylesheet" href="../../../css/myAnimate.css" />
    <link rel="stylesheet" href="../../../css/animate.css" />
    <link rel="stylesheet" href="../../../css/common.css" />
    <link rel="stylesheet" href="../../../css/style.css" />
    <link rel="stylesheet" href="../../css/company.css" />
    <link rel="stylesheet" href="../../css/fonts/iconfont.css" />
    <link
      rel="stylesheet"
      href="../../../plugin/bootstrap/dist/datepicker/datetimepicker.min.css"
    />
    <link
      rel="stylesheet"
      href="../../../plugin/bootstrap/dist/select/select.css"
    />
    <script type="text/javascript" src="../../../js/jquery.js"></script>
    <script
      type="text/javascript"
      src="../../../plugin/bootstrap/js/bootstrap.min.js"
    ></script>
    
    
    <script type="text/javascript" src="../../../plugin/layui/layui.js"></script>
    <script type="text/javascript" src="../../../js/"></script>
    <script
      type="text/javascript"
      src="../../../plugin/bootstrap/dist/datepicker/datetimepicker.min.js"
    ></script>
    
    <script
      type="text/javascript"
      src="../../../js/jquery-sortable.js"
    ></script>
    <script type="text/javascript" src="../../../js/pinyin.js"></script>
    <script
      type="text/javascript"
      src="../../../plugin/bootstrap/dist/select/select.js"
    ></script>
    <script type="text/javascript" src="../../../js/common.js"></script>
    <script type="text/javascript" src="../../js/company_common.js"></script>
    <link rel="stylesheet" href="../../../css/theme/blue.css" />
</head>

<body class="child_body">
    <div class="comModal p-15">
      <button class="btn btn-info" onclick="dialogShow()">派发</button>
      <button class="btn btn-info" onclick="dialogStatusShow()">
        审批状态
      </button>
      <button class="btn btn-info" onclick="dialogDetailShow()">
        建议详情
      </button>
      <button class="btn btn-info" onclick="dialogMethodShow()">
        新增策略
      </button>
      <button class="btn btn-info" onclick="setColumnDialog()">
        自定义列
      </button>
      <button class="btn btn-info" onclick="addStorageDialog()">
        添加库存
      </button>
      <div class="row m-t-15">
        <div class="col-md-4">
          <input id="selectTable" class="form-control" placeholder="点击展示弹窗" onclick="showTableDialog()" />
        </div>
      </div>
      <div class="row">
        <div class="col-md-4">
          <input id="searchSelectInput" class="form-control" placeholder="" />
        </div>
      </div>
    </div>
    
    <div id="dispatchDialog" class="modal fade" tabindex="-1" role="dialog">
      <div class="modal-dialog" role="document" style="width:1000px;">
        <div class="modal-content" style="width:1000px;">
          <div class="modal-header border0">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
              <span aria-hidden="true">&times;</span>
            </button>
            <h4 class="modal-title algin-center">派发</h4>
          </div>
          <div class="modal-body">
            <div class="formItem flex p-l-r-15">
              <label class="form-label w150">附件</label>
              <div class="flex-1">
                <div class="fileBtnBox" id="fileUploadTest">
                  <button class="btn btn-sm btn-info">
                    上传文件
                    <input type="file" onchange="fileUploadChange(this)" />
                  </button>
                  <div class="fileName flex">
                    <span class="flex-1 name"></span>
                    <span class="iconfont icon-close-rs"></span>
                  </div>
                </div>
              </div>
            </div>
            <div class="formItem flex p-l-r-15">
              <label class="form-label w150"><span class="red">*</span>通报单位</label>
              <div class="flex-1">
                <select class="selectpicker" title="请选择">
                  <option>Mustard</option>
                  <option>Ketchup</option>
                  <option>Barbecue</option>
                </select>
              </div>
              
            </div>
            <div class="formItem flex p-l-r-15">
              <label class="form-label w150">抄送单位</label>
              <div class="flex-1">
                <select class="selectpicker" title="请选择">
                  <option>Mustard</option>
                  <option>Ketchup</option>
                  <option>Barbecue</option>
                </select>
              </div>
              
            </div>
            <div class="formItem flex p-l-r-15">
              <label class="form-label w150"><span class="red">*</span>通报函号</label>
              <div class="flex-1"><input class="form-control" placeholder="请输入通报函号" /></div>
              
            </div>
            <div class="formItem flex p-l-r-15">
              <label class="form-label w150">通报函号-反馈表</label>
              <div class="flex-1"><input class="form-control" placeholder="请输入通报函号" /></div>
              
            </div>
            <div class="formItem flex p-l-r-15">
              <label class="form-label w150">反馈截止日期</label>
              <div class="flex-1"><div id="datetimepicker"></div></div>
              
            </div>
            <div class="formItem flex p-l-r-15">
              <label class="form-label w150">隐藏通报函</label>
              <div class="flex-1">
                <div class="comRadioBox p-t-5">
                  <label class="radio-inline">
                    <input type="radio" name="inlineRadioOptions" id="inlineRadio1" value="option1" />
                    是
                  </label>
                  <label class="radio-inline">
                    <input type="radio" name="inlineRadioOptions" id="inlineRadio2" value="option2" />
                    否
                  </label>
                </div>
              </div>
              
            </div>
          </div>
          <div class="modal-footer border0">
            <button type="button" class="cancel btn btn-default" data-dismiss="modal">
              取消
            </button>
            <button type="button" class="confirm btn btn-info">确认</button>
          </div>
        </div>
      </div>
    </div>
    <div id="statusChangeDialog" class="modal fade" tabindex="-1" role="dialog">
      <div class="modal-dialog fix-modal-dialog" role="document">
        <div class="modal-content">
          <div class="modal-header border0">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
              <span aria-hidden="true">&times;</span>
            </button>
            <h4 class="modal-title algin-center">核验待确认</h4>
          </div>
          <div class="modal-body">
            <div class="formItem p-l-r-15">
              <div class="label-block"><span class="red">*</span>核验意见</div>
              <textarea class="form-control textarea"></textarea>
            </div>
            <div class="formItem p-l-r-15">
              <div class="label-block">备注</div>
              <textarea class="form-control textarea"></textarea>
            </div>
            <div class="formItem p-l-r-15">
              <div class="label-block">是否归档</div>
              <div class="comRadioBox">
                <label class="radio-inline">
                  <input type="radio" name="inlineRadioOptions" id="inlineRadio1" value="option1" />
                  是
                </label>
                <label class="radio-inline">
                  <input type="radio" name="inlineRadioOptions" id="inlineRadio2" value="option2" />
                  否
                </label>
              </div>
            </div>
            <div class="formItem p-l-r-15">
              <div class="label-block">附件</div>
              <div class="fileBtnBox" id="fileUploadTest">
                <button class="btn btn-sm btn-info">
                  上传文件
                  <input type="file" onchange="fileUploadChange(this)" />
                </button>
                <div class="fileName flex">
                  <span class="flex-1 name"></span>
                  <span class="iconfont icon-close-rs"></span>
                </div>
              </div>
            </div>
          </div>
          <div class="modal-footer border0">
            <button type="button" class="cancel btn btn-default" data-dismiss="modal">
              取消
            </button>
            <button type="button" class="confirm btn btn-info">确认</button>
          </div>
        </div>
      </div>
    </div>
    <div id="advinceDetailDialog" class="modal fade" tabindex="-1" role="dialog">
      <div class="modal-dialog" role="document">
        <div class="modal-content">
          <div class="modal-header border0">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
              <span aria-hidden="true">&times;</span>
            </button>
            <h4 class="modal-title algin-center">建议详情</h4>
          </div>
          <div class="modal-body">
            <ul class="comTab infoTab clearfix m-b-15">
              <li class="active">事件类别</li>
              <li>目录浏览漏洞</li>
            </ul>
            <table class="table table-bordered">
              <thead>
                <tr>
                  <td width="50">序号</td>
                  <td>建议</td>
                </tr>
                </tbody>
              <tbody>
                <tr>
                  <td>1</td>
                  <td>
                    王文涛表示，中美元首旧金山会晤为两国经贸关系发展指明方向，双方应发挥两国商务部沟通交流机制的积极作用，为企业合作创造良好条件。王文涛重点就美国限制第三方对华出口光刻机、成熟制程芯片供应链调查、制裁打压中国企业等表达严正关切。
                  </td>
                </tr>
              </tbody>
            </table>
          </div>
          <div class="modal-footer border0">
            <button type="button" class="cancel btn btn-default" data-dismiss="modal">
              取消
            </button>
            <button type="button" class="confirm btn btn-info">确认</button>
          </div>
        </div>
      </div>
    </div>
    <div id="methodAddDialog" class="modal fade" tabindex="-1" role="dialog">
      <div class="modal-dialog" role="document">
        <div class="modal-content">
          <div class="modal-header border0">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
              <span aria-hidden="true">&times;</span>
            </button>
            <h4 class="modal-title algin-center">新增策略</h4>
          </div>
          <div class="modal-body">
            <div class="formItem flex p-l-r-15">
              <label class="form-label w90"><span class="red">*</span>策略名称</label>
              <div class="flex-1 relative">
                <input class="form-control" id="searchInput"/>
              </div>
            </div>
            <div class="formItem flex p-l-r-15">
              <label class="form-label w90"><span class="red">*</span>可见部门</label>
              <div class="flex-1 relative">
                <select class="selectpicker" title="请选择">
                  <option>Mustard</option>
                  <option>Ketchup</option>
                  <option>Barbecue</option>
                </select>
              </div>
            
            </div>
            <div class="formItem flex p-l-r-15">
              <label class="form-label w90">第一级</label>
              <div class="flex-1 flex">
                <select class="flex-1 selectpicker" title="请选择">
                  <option>Mustard</option>
                  <option>Ketchup</option>
                  <option>Barbecue</option>
                </select>
                <select class="flex-1 selectpicker" title="请选择">
                  <option>Mustard</option>
                  <option>Ketchup</option>
                  <option>Barbecue</option>
                </select>
              </div>
            </div>
            <div class="formItem flex p-l-r-15">
              <label class="form-label w90">第二级</label>
                <div class="flex-1 flex">
                  <select class="flex-1 selectpicker" title="请选择">
                    <option>Mustard</option>
                    <option>Ketchup</option>
                    <option>Barbecue</option>
                  </select>
                  <select class="flex-1 selectpicker" title="请选择">
                    <option>Mustard</option>
                    <option>Ketchup</option>
                    <option>Barbecue</option>
                  </select>
                </div>
              
            </div>
            <div class="formItem flex p-l-r-15">
              <label class="form-label w90"></label>
              <div class="flex-1">
                <button class="btn btn-info btn-sm"><span class="iconfont icon-add-r"></span>添加审核层次</button>
              </div>
            </div>
            <div class="formItem flex p-l-r-15">
              <label class="form-label w90">备注</label>
              <div class="flex-1">
                <textarea class="form-control textarea" placeholder="备注"></textarea>
              </div>
            
            </div>
          </div>
          <div class="modal-footer border0">
            <button type="button" class="cancel btn btn-default" data-dismiss="modal">
              取消
            </button>
            <button type="button" class="confirm btn btn-info">确认</button>
          </div>
        </div>
      </div>
    </div>
    <div id="editTableDialog" class="modal fade" tabindex="-1" role="dialog"> 
      <div class="modal-dialog" role="document" style="width:1000px;">
        <div class="modal-content" style="width:1000px;">
          <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
              <span aria-hidden="true">&times;</span>
            </button>
            <h4 class="modal-title algin-center">Table弹窗</h4>
          </div>
          <div class="modal-body">
            <div class="searchForm form-inline row">
              <div class="formItem col-md-4 flex">
                <label class="form-label w150"><span class="red">*</span>策略名称</label>
                <input class="form-control" />
              </div>
              <div class="formItem col-md-4 flex">
                <label class="form-label w150"><span class="red">*</span>可见部门</label>
                <select class="flex-1 selectpicker" title="请选择">
                  <option>Mustard</option>
                  <option>Ketchup</option>
                  <option>Barbecue</option>
                </select>
              </div>
            </div>
            <div class="searchBox p-0">
              <div class="searchBtnBox flex">
                <div class="flex-1 text-right">
                  <button type="button" class="btn btn-info btn-sm m-r-5" onclick="getParams()">
                    <span class="iconfont icon-search"></span>
                    <span class="text">查询</span>
                  </button>
                  <button type="button" class="btn btn-default btn-sm m-r-10" onclick="resetSearch()">
                    <span class="iconfont icon-reset"></span>
                    <span class="text">重置</span>
                  </button>
                </div>
              </div>
            </div>
            <div class="tableBox m-t-15">
              <table class="layui-hide" id="layuiDialogTable" lay-filter="layuiDialogTable"></table>
            </div>
          </div>
          <div class="modal-footer border0">
            <button type="button" class="cancel btn btn-default" data-dismiss="modal">
              取消
            </button>
            <button type="button" class="confirm btn btn-info" onclick="getData()">确认</button>
          </div>
        </div>
      </div>
    </div>
    <div id="columnDialog" class="modal fade" tabindex="-1" role="dialog"> 
      <div class="modal-dialog" role="document" style="width:1000px;">
        <div class="modal-content" style="width:1000px;">
          <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
              <span aria-hidden="true">&times;</span>
            </button>
            <h4 class="modal-title algin-center">自定义列</h4>
          </div>
          <div class="modal-body">
            <div class="columnsBox m-b-15">
              <div class="title">显示列</div>
              <ul id="sortable-1">
                <li class="default inline">Product 1</li>
                <li class="default inline">Product 2</li>
                <li class="default inline">Product 3</li>
                <li class="default inline">Product 4</li>
                <li class="default inline">Product 5</li>
                <li class="default inline">Product 6</li>
                <li class="default inline">Product 7</li>
                <li class="default inline">Product 8</li>
             </ul>
            </div>
            <div class="columnsBox">
              <div class="title">隐藏列</div>
              <ul id="sortable-2"></ul>
            </div>
          </div>
          <div class="modal-footer border0">
            <button type="button" class="cancel btn btn-default" data-dismiss="modal">
              取消
            </button>
            <button type="button" class="confirm btn btn-info" onclick="getData()">确认</button>
          </div>
        </div>
      </div>
    </div>
    <div id="addStorageDialog" class="modal fade" tabindex="-1" role="dialog"> 
      <div class="modal-dialog" role="document" style="width:1200px;">
        <div class="modal-content" style="width:1200px;">
          <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
              <span aria-hidden="true">&times;</span>
            </button>
            <h4 class="modal-title algin-center">添加库存</h4>
          </div>
          <div class="modal-body">
            <div class="myFormModal clearfix">
              <div class="myFormItem flex">
                <label><span class="red">*</span>客户名称</label>
                <div class="formBox">
                  <input class="form-control" />
                </div>
              </div>
              <div class="myFormItem flex">
                <label>价格区间</label>
                <div class="formBox flex items-center">
                  <input
                    class="form-control w90"
                    placeholder=""
                  />
                  <span class="m-l-r-5">-</span>
                  <input
                  class="form-control w90"
                  placeholder=""
                />
                </div>
              </div>
              <div class="myFormItem flex">
                <label>日期</label>
                <div class="formBox">
                  <input
                    class="form-control"
                    id="datetimepicker"
                    placeholder="请选择时间"
                  />
                </div>
              </div>
              <div class="myFormItem flex">
                <label>日期区间</label>
                <div class="formBox dateRange flex" id="dateRangePicker">
                  <input
                    class="flex-1 form-control"
                    id="startTime"
                    placeholder="起始时间"
                  />
                  <span class="p-l-r-5">至</span>
                  <input
                    class="flex-1 form-control"
                    id="endTime"
                    placeholder="结束时间"
                  />
                </div>
              </div>
              <div class="myFormItem flex">
                <label>下拉选择</label>
                <div class="formBox">
                  <div id="muitSelectDemoTest" class="comSelectBox"></div>
                </div>
              </div>
              <div class="myFormItem flex">
                <label>是否直接出库</label>
                <div class="formBox">
                  <div class="comRadioBox">
                    <label class="radio-inline">
                      <input
                        type="radio"
                        name="inlineRadioOptions"
                        id="inlineRadio1"
                        value="option1"
                      />
                      不启用
                      <span
                        class="iconfont icon-wenhao f_right m-l-5"
                        id="questionDemo"
                      ></span>
                    </label>
                    <label class="radio-inline">
                      <input
                        type="radio"
                        name="inlineRadioOptions"
                        id="inlineRadio2"
                        value="option2"
                      />
                      启用
                    </label>
                  </div>
                </div>
              </div>
              <div class="myFormItem flex">
                <label>是否直接出库</label>
                <div class="formBox">
                  <div class="comCheckBox">
                    <label class="checkbox-inline">
                      <input type="checkbox" id="inlineCheckbox1" value="option1" />
                      星期一
                    </label>
                    <label class="checkbox-inline">
                      <input type="checkbox" id="inlineCheckbox2" value="option2" />
                      星期二
                    </label>
                    <label class="checkbox-inline">
                      <input type="checkbox" id="inlineCheckbox3" value="option3" />
                      星期三
                    </label>
                  </div>
                </div>
              </div>
              <div class="myFormItem flex block">
                <label>备注</label>
                <div class="formBox">
                  <textarea class="form-control"></textarea>
                </div>
              </div>
            </div>
            <div class="searchBox p-0">
              <div class="searchBtnBox flex">
                <div class="flex-1 text-right">
                  <button type="button" class="btn btn-info-self btn-sm m-r-5" onclick="getParams()">
                    <!-- <span class="iconfont icon-search"></span> -->
                    <span class="text">查询</span>
                  </button>
                  <button type="button" class="btn btn-default-self btn-sm m-r-10" onclick="resetSearch()">
                    <!-- <span class="iconfont icon-reset"></span> -->
                    <span class="text">重置</span>
                  </button>
                </div>
              </div>
            </div>
            <div class="tableBox p-t-15 m-t-15" style="border-top:1px solid #f6f6f6;">
              <div class="tableOperBox flex">
                  <div class="text">
                    查询范围：<label><input type="checkbox" id="inputCheckTest"/><span>仅看未提交货架库存</span></label>
                  </div>
              </div>
              <div class="tableOperBox flex items-center m-b-10">
                  <div class="text">
                    <input type="checkbox" disabled />已选中<span class="red">0</span>条
                  </div>
                  <div class="m-l-15">0件0.0000吨</div>
                  <div class="m-l-15 flex items-center"><span class="redBox m-r-5"></span>已提交至货架库存</div>
              </div>
              <table id="bootstrapTable" lay-filter="bootstrapTable"></table>
            </div>
          </div>
          <div class="modal-footer border0">
            <button type="button" class="cancel btn btn-default" data-dismiss="modal">
              取消
            </button>
            <button type="button" class="confirm btn btn-info" onclick="getData()">确认</button>
          </div>
        </div>
      </div>
    </div>
</body>
<script>
  $(function () {
    $("#searchSelectInput").comSelect({

    })
    $("#searchInput").on('focus',function(e){
      var _val = $(e.target).val();
      var id = $(this).attr('id');
      var searchId = "comSearchResBox_"+id;
      if(_val&&$("#"+searchId).length){
        $("#"+searchId).slideDown()
      }
    })
    $("#searchInput").on('input',function(e){
      var val = e.target.value
      var id = $(this).attr('id');
      var searchId = "comSearchResBox_"+id;
      
      $(this).parent().addClass('relative');
      //请求数据
      var dataList = [{
        content:'第一条数据',
        id:1001,
      },
      {
        content:'第二条数据',
        id:1002,
      },
      {
        content:'第三条数据',
        id:1003,
      }]
      //数据渲染
      var htm = "";
      if($("#"+searchId).length){
        if(dataList&&dataList.length&&val){
          for(var i in dataList){
            var item = dataList[i];
            htm+='<li class="ellipsis" title="'+item.content+'" data-item='+JSON.stringify(item)+'>'+item.content+'</li>'
          }
        }
          $("#"+searchId).children('ul').html(htm)
          // $("#"+searchId).slideUp(); //收回搜索
          $("#"+searchId).slideDown();
      }else{
        htm = '<div id="'+searchId+'" class="comSearchResBox">'
        htm+='<ul>'

          for(var i in dataList){
            var item = dataList[i];
            htm+='<li class="ellipsis" title="'+item.content+'" data-item='+JSON.stringify(item)+'>'+item.content+'</li>'
          }
        htm+='</ul></div>';
        $(this).after(htm);
        $("#"+searchId).slideDown();
      }
     
      $("#"+searchId+" li").off('click').on('click',function(e){
        $(e.target).addClass('active').siblings().removeClass('active');
        var _data =  $(e.target).data('item');
        // var _json = JSON.parse(_data)
        $("#"+searchId).slideUp();
        $("#"+id).val(_data.content).data('item',_data);
      })
      $("#"+id).on('blur',function(){
        $("#"+searchId).slideUp();
      })
    })
    $("#datetimepicker").datePicker({
      dateType: "date",
      format: "datetime",
    });
  });
  function setColumnDialog(){
    $("#columnDialog").on('show.bs.modal',function(){
      // 拖拽排序
      var sortable1 = document.getElementById("sortable-1")
      var sortable2 = document.getElementById("sortable-2")
      var ops = {
        group: 'shared',
          animation: 150 };
        //初始化
        var sortable1 = Sortable.create(sortable1, ops);
        var sortable2 = Sortable.create(sortable2, ops);
    
      
    });
    $("#columnDialog").modal("show");
  };
  function addStorageDialog(){
    $("#addStorageDialog").on('shown.bs.modal',function(){
      //下拉选择
      $("#muitSelectDemoTest").comSelect({
        mutiselect: true,
        data: [
          { name: "ceshi1", id: 111 },
          { name: "ceshi2", id: 222 },
        ],
      });
      $.layuiTable({
        id: "bootstrapTable",
        page: true,
        cols: [
          //表头
          { type: "checkbox", fixed: "left" },
          {
            field: "id",
            title: "ID",
            width: 80,
            sort: true,
            fixed: "left",
            // totalRowText: "合计：",
          },
          { field: "username", title: "用户名", width: 80 },
          {
            field: "experience",
            title: "积分",
            sort: true,
            totalRow: true,
            width: "10%",
          },
          {
            field: "sex",
            title: "性别",
            sort: true,
            width: "10%",
            templet: function (d) {
              var _class = "blue";
              if (d.LAY_INDEX % 2 == 1) {
                _class = "gray";
              }
              return '<span class="mainColorBox ' + _class + '"></span>';
            },
          },
          {
            field: "score",
            title: "评分",
            sort: true,
            width: "10%",
            totalRow: "{{ parseInt(d.TOTAL_NUMS) }} 分",
            templet: function () {
              return '<div class="flex items-center fullHeight"><div class="comSwitch switchRound off"></div></div>';
            },
          },
          { field: "city", title: "城市" },
          { field: "sign", title: "签名" },
          { field: "classify", title: "职业" },
          {
            field: "wealth",
            title: "财富",
            width: 135,
            sort: true,
            totalRow: true,
          },
          {
            fixed: "right",
            title: "操作",
            width: 220,
            align: "center",
            //toolbar: "#barDemo",
          },
        ],
        data: [
          { username: "test1", id: 1001 },
          { username: "test2", id: 1002 },
        ],
        done: function (res, layuiTable) {
          // addTotalRow("bootstrapTable", layuiTable);
        },
      });
      $("#inputCheckTest").change(function(e){
        if(this.checked){
          $(this).siblings('span').css('color','#1890ff');
        }else{
          $(this).siblings('span').css('color','#444');
        }
      })
    });
    $("#addStorageDialog").modal("show");
  }
  function dialogShow() {
    $("#dispatchDialog").modal("show");
  }
  function dialogStatusShow() {
    $("#statusChangeDialog").modal("show");
  }
  function dialogDetailShow() {
    $("#advinceDetailDialog").modal("show");
  }
  function dialogMethodShow() {
    $("#methodAddDialog").modal("show");
  }
  function showTableDialog() {
    $("#editTableDialog").on('shown.bs.modal',function(){
      $.layuiTable({
        id: "layuiDialogTable",
        done: bindTableEvent,
        size:'sm',
        cols: [
          //表头
          { type: "checkbox",width:50 },//radio
          { field: "username", title: "用户名",width:200 },
          { field: "experience", title: "积分", },
          { field: "sex", title: "性别" },
          {field: "score",title: "评分",},
          { field: "city", title: "城市" },
          { field: "sign", title: "签名" },
          { field: "classify", title: "职业" },
          {field: "wealth",title: "财富",},
        ],
        data: [
          { username: "test1", id: 1001,"LAY_CHECKED":true},//默认选中
          { username: "test2", id: 1002 },
        ],
      });
      
    })
    $("#editTableDialog").modal("show");
    
  }
  function bindTableEvent(res,table) {
    console.log(table)
    window.dialogTable = table
    table.on('row(layuiDialogTable)',function(obj){
      console.log($(obj.tr).data('index'))
      //单选
      if(!$(obj.tr).find('.layui-form-radio').hasClass('layui-form-radioed')){
        $(obj.tr).find('.layui-form-radio').trigger('click')
        
      }
      //多选
      if(!$(obj.tr).find('.layui-form-checkbox').hasClass('layui-form-checked')){
        // $(obj.tr).find('.layui-form-checkbox').trigger('click')
      }else{
        
        // $(obj.tr).find('.layui-form-checkbox').trigger('click')
      }
    })
  }
  function getData(){
    var data = window.dialogTable.checkStatus('layuiDialogTable').data
    //这边在input里面绑定id数据    通过$("#id").data('id')获取
    //这是单选
    $("#selectTable").data('id',data.id).val(data.username);
    //多选
    var ids = [],names=[];
    for(var i in data){
      var item = data[i];
      ids.push(item.id)
      names.push(item.username)
    }
    $("#selectTable").data('id',ids.join(',')).val(names.join(','));
    $("#editTableDialog").modal("hide");
    console.log($("#selectTable").data('id'))
  }
  function fileUploadChange(e) {
      InitFileView(e, "fileUploadTest");
      $("#fileUploadTest .iconfont")
        .off("click")
        .on("click", function () {
          $(this).siblings(".name").text("");
          $(this).parent(".fileName").hide().siblings(".btn").show();
        });
    }
</script>

</html>